Field of the Invention
The invention relates to an electronic apparatus, a method of controlling the same, a storage medium, and an accessory device, and more particularly to detection control for detecting connection between an electronic apparatus body and an accessory, and switching control for switching a communication method (communication protocol) of communication between the electronic apparatus body and the accessory.
Description of the Related Art
In general, electronic apparatuses include an image pickup apparatus, such as a digital camera. Conventionally, in the image pickup apparatus, such as the digital camera, when an accessory, such as a strobe device or an interchangeable lens unit, is connected to the body of the image pickup apparatus (hereinafter referred to as the camera body), connection detection is performed for detecting connection of communication terminals of the camera body and the accessory. Then, when the connection is detected, communication is performed between the camera body and the accessory, and if the camera body receives no response from the accessory or there is an anomaly in received data, the camera body determines that the connection is abnormal.
Further, when switching a communication method (i.e. a communication protocol), communication is performed by a communication method before the switching (referred to as the old communication method) to confirm compatibility of the camera body or accessory with a communication method after the switching (referred to as the new communication method), and only after the compatibility is confirmed, the communication method is switched to the new communication method.
For example, there has been proposed a technique in which an interchangeable lens unit is equipped with first to third information transmitting sections, and when the interchangeable lens unit is connected to a camera body, the interchangeable lens unit selects the first information transmitting section or one of the second and third information transmitting sections to perform communication with the camera body (see e.g. Japanese Patent Laid-Open Publication No. H02-693030). In the proposed technique, when transmitting information by the second information transmitting section, if an interchangeable lens unit is equipped with the third information transmitting section, the interchangeable lens unit switches the information transmitting section to one of the second and third information transmitting sections, for communication with the camera body.
However, in the camera described in Japanese Patent Laid-Open Publication No. H02-693030, to confirm connection between the interchangeable lens unit and the camera body, it is necessary to perform determination with respect to the contents of a response sent from the interchangeable lens unit to the camera body after the connection. Therefore, the camera body is required to verify the accuracy of the determination, and further, it takes much time to perform processing for the determination.
Further, when switching the communication method from the old one to the new one, only after performing confirmation of the compatibility with the new one using the old one, the communication method is changed to the new one, so that it takes much time to change the communication method.